﻿@inherits BaseInputInline<bool>

@namespace FluentCMS.Web.UI.Components

@if (Visible)
{
    <FormField Cols="Cols" Dense="@Dense" Id="@Id" Hint="@Hint" Label="@Label" LabelFragment="@LabelFragment" Required="@Required">
        <label class="@this.GetClasses()">
            <input @attributes="AdditionalAttributes" checked="@BindConverter.FormatValue(CurrentValue)" class="@this.ClassName("FormSwitchInput")" 
                   disabled="@Disabled" id="@Id" name="@NameAttributeValue" type="checkbox" value="@bool.TrueString" 
                   @onchange="EventCallback.Factory.CreateBinder<bool>(this, __value => CurrentValue = __value, CurrentValue)" />
            <div class="@this.ClassName("FormSwitchInner")"></div>
            @if (!string.IsNullOrEmpty(Text))
            {
                <span class="@this.ClassName("FormSwitchLabel")">
                    @Text
                </span>
            }
        </label>
    </FormField>
}
